<?php


    
function restaurant_favourite_restaurant_delete($rid){
    db_delete('ep_favourite_restaurant')
        ->condition('rid',$rid)
        ->execute();
}
 
function restaurant_favourite_offer_delete($oid){
    db_delete('ep_favourite_offer')
        ->condition('oid',$oid)
        ->execute();
}

function restaurant_add_offer_to_favourite($oid){
     global $user;
     db_insert('ep_favourite_offer')
        ->fields(array(
            'uid'=>$user->uid,
            'oid'=>$oid
        ))
        ->execute();
     drupal_set_message(t("Ajánlat sikeresen felvéve a kedvencek közé."));
     drupal_goto('restaurant/menuk');   
}
 
function restaurant_add_restaurant_to_favourite($rid){
     global $user;
     db_insert('ep_favourite_restaurant')
        ->fields(array(
            'uid'=>$user->uid,
            'rid'=>$rid
        ))
        ->execute();
     drupal_set_message(t("Étterem sikeresen felvéve a kedvencek közé."));
     drupal_goto('restaurant/menuk');
 }